Skip to content

fix(infra)(#321): aggregator-proxy /health passes through to backend#323

Merged
vrogojin merged 1 commit into
mainfrom
fix/aggregator-proxy-health-passthrough
Jun 8, 2026
Merged

fix(infra)(#321): aggregator-proxy /health passes through to backend#323
vrogojin merged 1 commit into
mainfrom
fix/aggregator-proxy-health-passthrough

Conversation

@vrogojin

Copy link
Copy Markdown
Contributor

Summary

The proxy was returning a hardcoded {"status":"ok"} for /health, hiding the backend's rich health response (role, sharding, commitment_queue, database). Tools like unicity-infra-probe marked the aggregator DEGRADED because they couldn't distinguish a healthy backend from a wedged one.

Pass /health through to the backend. Proxy liveness becomes implicit.

Verified live

$ curl -s https://aggregator-unicity-dev.dyndns.org/health | jq -c
{"status":"ok","role":"standalone","serverId":"0b96d7aa0059-1",
 "sharding":{"mode":"standalone","shardIdLen":4,"shardId":0},
 "details":{"commitment_queue":"0","commitment_queue_status":"healthy",
              "database":"connected"}}

Follow-ups

  • unicity-infra-probe still reports DEGRADED because it expects {status:"healthy", database:"ok"} rather than the actual aggregator schema {status:"ok", details.database:"connected"}. That's probe-side schema drift, separate fix in unicitynetwork/infra-probe.

Test plan

  • curl https://aggregator-unicity-dev.dyndns.org/health returns the rich payload (verified)
  • proxy container is healthy (verified)
  • JSON-RPC POST still works (proxy unchanged for other locations)

The proxy was returning a hardcoded {"status":"ok"} for /health,
which hid the backend's rich health response (role, sharding,
commitment_queue, database). unicity-infra-probe and similar
monitoring tools mark the aggregator DEGRADED because they can't
distinguish a healthy backend from a wedged one — both produce
the same canned reply.

Pass /health through to the backend like every other path. Proxy
liveness becomes implicit: if nginx forwards and reads the reply,
both halves are alive.

Live response now (verified):
  {"status":"ok","role":"standalone","details":{
    "commitment_queue":"0","database":"connected", ...}}

(Note: unicity-infra-probe still reports DEGRADED because it
expects `{status:"healthy", database:"ok"}` rather than the
aggregator binary's actual `{status:"ok", details.database:
"connected"}` schema — that's a probe-side schema drift, not
fixed by this change.)
Base automatically changed from integration/all-fixes to main May 29, 2026 17:51
@vrogojin vrogojin merged commit 171a01c into main Jun 8, 2026
@vrogojin vrogojin deleted the fix/aggregator-proxy-health-passthrough branch June 8, 2026 08:34
vrogojin added a commit that referenced this pull request Jun 8, 2026
… surfaces nametag

Two related changes that close the loop for self-hosted nametag minting:

1) aggregator-proxy serves the trust base. The compose file bind-
   mounts ./data/genesis:/etc/aggregator-config:ro into agg-proxy
   and the nginx config exposes
   https://<aggregator-domain>/.well-known/trust-base.json
   as a public alias. Wallets pointed at our aggregator can now
   download the matching trust base over HTTPS — required for the
   SDK's verification path to come up without skipVerification=true.

   The /health location also picks up the pass-through fix from
   PR #323 so the rich backend response (role, database, sharding)
   is visible externally — necessary to land both changes against
   integration/all-fixes together.

2) render-discovery.sh surfaces the nametag. The discovery doc at
   https://<faucet-domain>/.well-known/faucet.json was showing
   nametag: null even after a successful mint. The watcher now
   tails for the nametag_verified log line (emitted by js-faucet
   AFTER mint+resolve completes) and rewrites identity.json with
   the verified nametag. The registering_nametag line is NOT used
   as a signal because it fires BEFORE the mint commits and would
   surface unverified state.

Verified live end-to-end on this host:
  - faucet logs: aggregator_override_active, nametag_verified
  - mongo: commitments=1, aggregator_records=1
  - relay: NAMETAG_BINDING (kind 30078) event for xaleava landed
  - discovery: identity.nametag="xaleava"

The companion js-faucet PR #3 (env override wiring) and sphere-sdk
PR #324 (relay + run-faucet env passthrough) are both still required
for the end-to-end flow.
vrogojin added a commit that referenced this pull request Jun 8, 2026
… surfaces nametag

Two related changes that close the loop for self-hosted nametag minting:

1) aggregator-proxy serves the trust base. The compose file bind-
   mounts ./data/genesis:/etc/aggregator-config:ro into agg-proxy
   and the nginx config exposes
   https://<aggregator-domain>/.well-known/trust-base.json
   as a public alias. Wallets pointed at our aggregator can now
   download the matching trust base over HTTPS — required for the
   SDK's verification path to come up without skipVerification=true.

   The /health location also picks up the pass-through fix from
   PR #323 so the rich backend response (role, database, sharding)
   is visible externally — necessary to land both changes against
   integration/all-fixes together.

2) render-discovery.sh surfaces the nametag. The discovery doc at
   https://<faucet-domain>/.well-known/faucet.json was showing
   nametag: null even after a successful mint. The watcher now
   tails for the nametag_verified log line (emitted by js-faucet
   AFTER mint+resolve completes) and rewrites identity.json with
   the verified nametag. The registering_nametag line is NOT used
   as a signal because it fires BEFORE the mint commits and would
   surface unverified state.

Verified live end-to-end on this host:
  - faucet logs: aggregator_override_active, nametag_verified
  - mongo: commitments=1, aggregator_records=1
  - relay: NAMETAG_BINDING (kind 30078) event for xaleava landed
  - discovery: identity.nametag="xaleava"

The companion js-faucet PR #3 (env override wiring) and sphere-sdk
PR #324 (relay + run-faucet env passthrough) are both still required
for the end-to-end flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant